package io;

import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

public class WorkingThree {
    public static void main(String[] args) {
        Properties properties = new Properties();
        FileReader fileReader=null;
        Student student = new Student();
        try {
             fileReader = new FileReader("E:\\java\\springcloud\\io-流\\src\\io\\student.properties");
            properties.load(fileReader);
            String id = properties.get("id").toString();
            String name = properties.get("name").toString();
            student.setName(name);
            student.setId(Integer.parseInt(id));
            System.out.println(student.toString());
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                fileReader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
